\begin{tikzpicture}

\definecolor{darkgray176}{RGB}{176,176,176}
\definecolor{steelblue31119180}{RGB}{31,119,180}

\begin{axis}[
colorbar,
colorbar style={ylabel={Line Number}},
colormap/viridis,
point meta max=9,
point meta min=0,
tick align=outside,
tick pos=left,
title={Line Collection with mapped colors},
x grid style={darkgray176},
xmin=0, xmax=9,
xtick style={color=black},
y grid style={darkgray176},
ymin=0, ymax=18,
ytick style={color=black}
]
\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,0)
--(axis cs:1,1)
--(axis cs:2,2)
--(axis cs:3,3)
--(axis cs:4,4)
--(axis cs:5,5)
--(axis cs:6,6)
--(axis cs:7,7)
--(axis cs:8,8)
--(axis cs:9,9);

\path [draw=steelblue31119180, dash pattern=on 6.4pt off 1.6pt on 1pt off 1.6pt]
(axis cs:0,1)
--(axis cs:1,2)
--(axis cs:2,3)
--(axis cs:3,4)
--(axis cs:4,5)
--(axis cs:5,6)
--(axis cs:6,7)
--(axis cs:7,8)
--(axis cs:8,9)
--(axis cs:9,10);

\path [draw=steelblue31119180, semithick, dash pattern=on 9.6pt off 2.4pt on 1.5pt off 2.4pt]
(axis cs:0,2)
--(axis cs:1,3)
--(axis cs:2,4)
--(axis cs:3,5)
--(axis cs:4,6)
--(axis cs:5,7)
--(axis cs:6,8)
--(axis cs:7,9)
--(axis cs:8,10)
--(axis cs:9,11);

\path [draw=steelblue31119180, thick, dash pattern=on 12.8pt off 3.2pt on 2pt off 3.2pt]
(axis cs:0,3)
--(axis cs:1,4)
--(axis cs:2,5)
--(axis cs:3,6)
--(axis cs:4,7)
--(axis cs:5,8)
--(axis cs:6,9)
--(axis cs:7,10)
--(axis cs:8,11)
--(axis cs:9,12);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,4)
--(axis cs:1,5)
--(axis cs:2,6)
--(axis cs:3,7)
--(axis cs:4,8)
--(axis cs:5,9)
--(axis cs:6,10)
--(axis cs:7,11)
--(axis cs:8,12)
--(axis cs:9,13);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,5)
--(axis cs:1,6)
--(axis cs:2,7)
--(axis cs:3,8)
--(axis cs:4,9)
--(axis cs:5,10)
--(axis cs:6,11)
--(axis cs:7,12)
--(axis cs:8,13)
--(axis cs:9,14);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,6)
--(axis cs:1,7)
--(axis cs:2,8)
--(axis cs:3,9)
--(axis cs:4,10)
--(axis cs:5,11)
--(axis cs:6,12)
--(axis cs:7,13)
--(axis cs:8,14)
--(axis cs:9,15);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,7)
--(axis cs:1,8)
--(axis cs:2,9)
--(axis cs:3,10)
--(axis cs:4,11)
--(axis cs:5,12)
--(axis cs:6,13)
--(axis cs:7,14)
--(axis cs:8,15)
--(axis cs:9,16);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,8)
--(axis cs:1,9)
--(axis cs:2,10)
--(axis cs:3,11)
--(axis cs:4,12)
--(axis cs:5,13)
--(axis cs:6,14)
--(axis cs:7,15)
--(axis cs:8,16)
--(axis cs:9,17);

\path [draw=steelblue31119180, very thin, dash pattern=on 3.2pt off 0.8pt on 0.5pt off 0.8pt]
(axis cs:0,9)
--(axis cs:1,10)
--(axis cs:2,11)
--(axis cs:3,12)
--(axis cs:4,13)
--(axis cs:5,14)
--(axis cs:6,15)
--(axis cs:7,16)
--(axis cs:8,17)
--(axis cs:9,18);

\end{axis}

\end{tikzpicture}
